import url from '@/tool/index.js'
export const uploadFile = (val) => {		//图片上传
	return new Promise(resolve => {
		uni.uploadFile({
			url: url+'/api/common/upload', 
			filePath: val,
			name: 'file',
			success: (res) => {
				resolve(res.data)
			},
			fail:(res)=>{
				console.log(res);
			}
		});
	})
}
// export const downloadFile = (imgUrl) => {		//图片上传
// 	return new Promise(resolve => {
// 		uni.downloadFile({
// 		    url: imgUrl, //仅为示例，并非真实的资源
// 		    success: (res) => {
// 				console.log(res);
// 		    	resolve(res.tempFilePath)
// 		    },
// 		});
// 	})
// }